﻿#ifndef SHAREEVENTHANDLER_H
#define SHAREEVENTHANDLER_H
#include "IShareServiceController.h"
#include "IdeaShareDef.h"
#include "INotifyUI.h"
using namespace Huawei;
using namespace Idea;

class ShareEventHandler : public Huawei::Idea::IShareEventHandler{
public:
    ShareEventHandler(INotifyUI* evtHandler, ShareServiceController* controller);
    ~ShareEventHandler();
    void OnError(ShareAppErr errorCode, std::string errorMsg, void* extralInfo);

    void OnDiscoverResult(DiscoverResult* discoverResult);
    void OnDiscoverFailed(ShareAppErr errorCode, std::string errorMsg);

    void OnConnectResult(DeviceInfo* deviceInfo);
    void OnConnectFailed(ShareAppErr errorCode, std::string errorMsg);

    void OnDisconnectResult(int reason);
    void OnDisconnectFailed(ShareAppErr errorCode, std::string errorMsg);

    void OnSharePlayResult();
    void OnSharePlayFailed(ShareAppErr errorCode, std::string errorMsg);

    void OnShareStopResult(int reason);
    void OnShareStopFailed(ShareAppErr errorCode, std::string errorMsg);

    void OnGetRemoteServiceStatusResult(RemoteServiceStatus* remoteServiceStatus);
    void OnGetRemoteServiceStatusFailed(ShareAppErr errorCode, std::string errorMsg);

    void OnSetRemoteMicMuteResult(int result);
    void OnSetRemoteMicMuteFailed(ShareAppErr errorCode, std::string errorMsg);

    void OnSetRemoteSpeakerVolumeResult(int result);
    void OnSetRemoteSpeakerVolumeFailed(ShareAppErr errorCode, std::string errorMsg);

    void OnSetRemoteSpeakerMuteResult(int result);
    void OnSetRemoteSpeakerMuteFailed(ShareAppErr errorCode, std::string errorMsg);

    void OnSetRemoteCameraMuteResult(int result);
    void OnSetRemoteCameraMuteFailed(ShareAppErr errorCode, std::string errorMsg);

    void OnSetLeaveConferenceResult(int result);
    void OnSetLeaveConferenceFailed(ShareAppErr errorCode, std::string errorMsg);

    void OnSetEndConferenceResult(int result);
    void OnSetEndConferenceFailed(ShareAppErr errorCode, std::string errorMsg);

    void OnGetSDKLatestVersionResult(std::string version);
    void OnGetSDKLatestVersionFailed(ShareAppErr errorCode, std::string errorMsg);

    void OnSetTLSFailed(ShareAppErr errorCode, std::string errorMsg);

    void OnSetMouseShapeResult(int result);
    void OnSetMouseShapeFailed(ShareAppErr errorCode, std::string errorMsg);

    void OnRemoteServiceStatusChangedNotify(RemoteServiceStatus *remoteServiceStatus, int index);

    void OnDevConfStateNotify(ConfSate confState, AuxState auxState);
    void OnShareStatusChangedNotify(ShareAppServerStatus status, ShareAppErr reason);
private:
    INotifyUI* mUiEvtHandler;
    ShareServiceController* mshareController;
};

#endif // SHAREEVENTHANDLER_H
